/*
 ***************************************************************************
 * MediaTeK Inc.
 * 4F, No. 2 Technology	5th	Rd.
 * Science-based Industrial	Park
 * Hsin-chu, Taiwan, R.O.C.
 *
 * (c) Copyright 2002-2012, MTK.
 *
 * All rights reserved.	MediaTeK's source	code is	an unpublished work	and	the
 * use of a	copyright notice does not imply	otherwise. This	source code
 * contains	confidential trade secret material of MediaTeK Tech. Any attemp
 * or participation	in deciphering,	decoding, reverse engineering or in	any
 * way altering	the	source code	is stricitly prohibited, unless	the	prior
 * written consent of MediaTeK, Inc. is obtained.
 ***************************************************************************

	Module Name:
	omci_me_private.h

	Abstract:

	Revision History:
	Who			When			What
	--------	----------		----------------------------------------------
	Name		Date			Modification logs
	mingang.tan	2018/8/16	Create
*/

#ifndef  _OMCI_PRIVATE_ME_H_
#define _OMCI_PRIVATE_ME_H_

#include "omci_general_func.h"
#include "omci_me_external.h"
#include "xpon_ioctl_if.h"

#define OMCI_CLASS_ID_RESERVED_247_ME                       	247
#define OMCI_CLASS_ID_RESERVED_351_PM                       	351
#define OMCI_CLASS_ID_RESERVED_250_ME                       	250
#define OMCI_CLASS_ID_RESERVED_347_ME                      		347
#define OMCI_CLASS_ID_RESERVED_350_ME							350
#define OMCI_CLASS_ID_RESERVED_352_ME                      		352
#ifdef TCSUPPORT_PON_ROSTELECOM
#define OMCI_CLASS_ID_HUAWEI_CONFIG_UPLOAD						353
#endif
#define OMCI_CLASS_ID_RESERVED_353_ME							353
#define OMCI_CLASS_ID_RESERVED_367_ME							367
#define OMCI_CLASS_ID_RESERVED_373_ME							373
#define OMCI_CLASS_ID_RESERVED_370_ME							370
#define OMCI_CLASS_ID_RESERVED_65408_ME							65408
#define OMCI_CLASS_ID_RESERVED_65414_ME							65414
#define OMCI_CLASS_ID_RESERVED_65415_ME							65415
#define OMCI_CLASS_ID_RESERVED_65425_ME							65425
#define OMCI_CLASS_ID_RESERVED_65427_ME                       	65427

/*******************************************************************************************************************************
CTC ONU loop_detect(Class ID 65528)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_ctc_loop_detect_s
{
	uint16_t meId;
	char operatorId[4];
	uint16_t LoopDectMagt;
	uint16_t LoopPortDown;
	uint16_t LoopDectMsgFreq;  
	uint16_t LoopRecvInterval;
	omci_table_attr_t PortAndVLANTbl;
}omci_ctc_loop_detect_t, *omci_ctc_loop_detect_ptr;

/*******************************************************************************************************************************

CTC ONU Capability(Class ID 65529)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_ctc_onu_cap_s
{
    uint16_t meId;
    char operatorId[4];
    uint8_t ctcSpecVersion;
    uint8_t onuType;
    uint8_t onuTxPowerCtrl;    
}omci_ctc_onu_cap_t, *omci_ctc_onu_cap_ptr;


/*******************************************************************************************************************************
CTC LOID authentication(Class ID 65530)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_ctc_loid_auth_s{
    uint16_t 	meId;
	char		operatorId[4];
	char		loid[24];
	char		password[12];
    uint8_t 	authStatus;
}omci_ctc_loid_auth_t, *omci_ctc_loid_auth_ptr;

/*******************************************************************************************************************************
CTC Extended multicast operations profiles(Class ID 65531)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_ctc_ext_multicast_op_profile_s{
    uint16_t 	meId;
    uint8_t		igmpVer;	
    uint8_t		igmpFunc;
    uint8_t		immediateLeave;
    uint16_t	upIgmpTci;
    uint8_t		upIgmpTagCtrl;
	uint32_t	upIgmpRate;
    omci_table_attr_t dynAccessCtrlListTable;
    omci_table_attr_t staticAccessCtrlListTable;
    omci_table_attr_t lostGroupListTable;
    uint8_t		robustness;
	char		querierIpAddr[16];
	uint32_t	queryInterval;
	uint32_t	queryMaxRespTime;
	uint32_t	lastMemberQueryInterval;
    uint8_t		unAuthJoinReqBehaviour;
	char		downIgmpMultiTci[3];
}omci_ctc_ext_multicast_op_profile_t, *omci_ctc_ext_multicast_op_profile_ptr;


/*******************************************************************************************************************************
CUC ONU Capability(Class ID 65457)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_cuc_onu_cap_s{
    uint16_t 	meId;
    char 		operatorId[4];
    uint8_t		specVer;
    uint8_t		onuType;
    uint8_t		txPwrSupCtrl;
}omci_cuc_onu_cap_t, *omci_cuc_onu_cap_ptr;

/*******************************************************************************************************************************
CUC ONU Transcever Info(Class ID 65458)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_cuc_onu_trans_info_s{
    uint16_t 	meId;
    uint8_t 	moduleType;
    uint8_t		moduleSubType;
    uint8_t		usedType;
    uint8_t		encapType;
	uint16_t	txWaveLen;
	uint16_t	rxWaveLen;
	uint8_t		vendorName[TRANS_VENDOR_NAME_SIZE];
	uint8_t		vendorPN[TRANS_VENDOR_PN_SIZE];
	uint8_t		vendorSN[TRANS_VENDOR_SN_SIZE];
}omci_cuc_onu_trans_info_t, *omci_cuc_onu_trans_info_ptr;

/*******************************************************************************************************************************
ALCATEL VOIP Call Statistics(Class ID 65284)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_voip_call_statistics_s
{
    uint16_t meId;
    omci_table_attr_t callHistoryTbl;
}omci_alcatel_voip_call_statistics_t, *omci_alcatel_voip_call_statistics_ptr;


/*******************************************************************************************************************************
ALCATEL Clock data set(Class ID 65314)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_clock_data_set_s
{
    uint16_t meId;
    uint8_t domain;
    uint8_t clockClass;
    uint8_t clockAccuracy;
    uint8_t clockPri1;
    uint8_t clockPri2;
}omci_alcatel_clock_data_set_t, *omci_alcatel_clock_data_set_ptr;

/*******************************************************************************************************************************
ALCATEL PTP Master Config Data(Class ID 65315)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_ptp_master_cfg_data_s
{
    uint16_t meId;
    uint16_t clockDataSetPtr;
    uint8_t stepMode;
    uint8_t delayMechanism;
    uint8_t intervalOfSyncMsg;
    uint8_t intervalOfDelayMsg;
    uint8_t intervalOfPdelayMsg;
    uint8_t intervalOfAnnounceMsg;
}omci_alcatel_ptp_master_cfg_data_t, *omci_alcatel_ptp_master_cfg_data_ptr;

/*******************************************************************************************************************************
ALCATEL PTP Port(Class ID 65316)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_ptp_port_s
{
    uint16_t meId;
    uint16_t ptpMasterCfgDataPtr;
    uint16_t pptpUniPtr;
    uint8_t adminState;
    uint16_t tci;
}omci_alcatel_ptp_port_t, *omci_alcatel_ptp_port_ptr;

/*******************************************************************************************************************************
ALCATEL PTP Port(Class ID 65281)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_total_gemport_pm_s
{
    uint16_t meId;
    uint8_t interEndTime;
    uint16_t thresholdId;
    uint32_t lostGemFrameCntDown;
    uint32_t lostGemFrameCnUp;
    uint8_t rcvGemFrameCnt[5];
    uint8_t rcvGemBlock[5];
    uint8_t TransGemBlock[5];
    uint32_t impairedBlock;
    uint8_t transGemFrameCnt[5];
    uint32_t badGemHeaderRcsCnt;
    uint64_t rcvGemBlock64bit;
    uint64_t transGemBlock64bit;
}omci_alcatel_total_gemport_pm_t, *omci_alcatel_total_gemport_pm_ptr;

/*******************************************************************************************************************************
ALCATEL Ethernet Traffic PM(Class ID 65282)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_eth_traffic_pm_s
{
    uint16_t meId;
    uint8_t interEndTime;
    uint16_t thresholdId;
    uint32_t upFrameCnt;
    uint32_t downFrameCnt;
    uint32_t upBytesCnt;
    uint32_t downBytesCnt;
    uint32_t dropUpFrameCnt;
    uint32_t dropUpBytesCnt;
    uint32_t dropDownFrameCnt;
    uint32_t multicastUpFrameCnt;
    uint32_t multicastDownFrameCnt;
    uint64_t upBytesCnt64bit;
    uint64_t downBytesCnt64bit;
    uint64_t upFrameCnt64bit;
    uint64_t downFrameCnt64bit;
}omci_alcatel_eth_traffic_pm_t, *omci_alcatel_eth_traffic_pm_ptr;

/*******************************************************************************************************************************
ALCATEL VLAN Tag Downstream Egress Behavior Supplemental1(Class ID 65305)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_vlan_tag_down_supply1_s
{
    uint16_t meId;
    uint8_t vlanTxDefaultTag;
    omci_table_attr_t vlanTxBehaviorTbl;
}omci_alcatel_vlan_tag_down_supply1_t, *omci_alcatel_vlan_tag_down_supply1_ptr;

/*******************************************************************************************************************************
ALCATEL VLAN TAG Upstream Policer(Class ID 65306)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_vlan_tag_up_policy_s
{
    uint16_t meId;
    omci_table_attr_t vlanRxBehaviorTbl;
}omci_alcatel_vlan_tag_up_policy_t, *omci_alcatel_vlan_tag_up_policy_ptr;

/*******************************************************************************************************************************
ALCATEL ONT Optical Supervision Status (Class ID 65295)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_ont_optical_status_s
{
    uint16_t meId;
    uint8_t powerFeedVolMI;
    uint16_t powerFeedVol;
    uint8_t rcvOpticalPowerMI;
    uint16_t rcvOpticalPower;
    uint8_t transOpticalPowerMI;
    uint16_t transOpticalPower;
    uint8_t laserBiasCurrentMI;
    uint16_t laserBiasCurrent;
    uint8_t temperatureMI;
    uint16_t temperature;
}omci_alcatel_ont_optical_status_t, *omci_alcatel_ont_optical_status_ptr;

/*******************************************************************************************************************************
ALCATEL UNI Supplement 1 V2(Class ID 65297)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_uni_supply_1v2_s
{
    uint16_t meId;
    uint8_t downTagHandleMode;
    uint8_t igmpACLMethold;
    uint16_t multicastVIDValue;
    uint8_t multicastPbitValue;
    uint8_t igmpChannelBrPorNum;
    uint8_t upDefaultPri;
    uint8_t maxNumOfHostPerUni;
}omci_alcatel_uni_supply_1v2_t, *omci_alcatel_uni_supply_1v2_ptr;

/*******************************************************************************************************************************
ALCATEL ONT GENERIC(Class ID 65296)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_ont_generic_v2_s
{
    uint16_t meId;
    uint8_t igmpSnoopEnable;
    uint8_t forceDataStorageCmd;
    uint32_t TimeOfLastDataStorageOp;
    uint8_t craftInd;
    uint8_t ethPortTrafficInd;
    uint8_t staticMulticastVlanTransInd;
    uint32_t aluProMeCapBitMap;
    uint8_t flexPQAssignCap;
    uint8_t slidCap;
    uint8_t ypsSN[12];
    uint32_t aluSpecBehaveField;
    uint8_t aluProMeCapBitMapPart2[25];
}omci_alcatel_ont_generic_v2_t, *omci_alcatel_ont_generic_v2_ptr;

/*******************************************************************************************************************************
ALCATEL Gemport Protocol Monitoring History Data Part 2(Class ID 65300)

********************************************************************************************************************************/

typedef struct GNU_PACKED omci_alcatel_gemport_protocol_pm_s
{
    uint16_t meId;
    uint8_t interEndTime;
    uint16_t thresholdId;
    uint32_t lostGemFrameCntUp;
    uint8_t transGemFrameCnt[5];
}omci_alcatel_gemport_protocol_pm_t, *omci_alcatel_gemport_protocol_pm_ptr;

/*******************************************************************************************************************************
Reserved ME

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_reserved_me_247_s
{
	uint16_t meId;
	uint8_t  value1;
	uint16_t value2;
	uint8_t  value3[9];
	uint16_t value4;
	uint32_t vlaue5;
	uint8_t vlaue[11];
}omci_reserved_me_247_t, *omci_reserved_me_247_ptr;

typedef struct GNU_PACKED omci_reserved_me_250_s
{
    uint16_t meId;
    uint8_t value1;
    uint16_t value2;
    uint16_t value3;
    uint16_t value4;
    uint32_t vlaue5;
    uint32_t vlaue6;
    uint32_t vlaue7;
    uint32_t vlaue8;
    uint32_t vlaue9;
}omci_reserved_me_250_t, *omci_reserved_me_250_ptr;

typedef struct GNU_PACKED omci_reserved_me_347_s
{
    uint16_t meId;
    uint8_t value1;
    uint8_t value2[6];
    uint8_t value3[25];
    uint8_t value4[16];
    uint8_t vlaue5[16];
    uint8_t vlaue6[16];
    uint8_t vlaue7[16];
    uint8_t vlaue8[16];
    uint8_t vlaue9[16];
    uint8_t vlaue10[16];
    uint8_t vlaue11[16];
    uint8_t vlaue12[16];
    uint8_t value13[25];
}omci_reserved_me_347_t, *omci_reserved_me_347_ptr;

typedef struct GNU_PACKED omci_reserved_me_351_s
{
    uint16_t meId;
    uint8_t value1;
    uint16_t value2;
    uint8_t value3;
    uint8_t value4;
    uint8_t vlaue5;
    uint8_t vlaue6;
    uint8_t vlaue7;
    uint8_t vlaue8;
    uint8_t vlaue9;
    uint8_t vlaue10;
    uint8_t vlaue11;
    uint8_t vlaue12;
    uint8_t value13;
    uint8_t value14;
    uint8_t value15;
    uint8_t value16;
}omci_reserved_me_351_t, *omci_reserved_me_351_ptr;

typedef struct GNU_PACKED omci_reserved_me_350_s
{
    uint16_t meId;
    uint8_t value1;
    uint8_t value2;
    uint8_t value3;
    uint8_t value4;
    uint16_t vlaue5;
    uint32_t vlaue6;
    uint8_t vlaue7[16];
    uint32_t vlaue8;
    uint8_t vlaue9[6];
}omci_reserved_me_350_t, *omci_reserved_me_350_ptr;

typedef struct GNU_PACKED omci_reserved_me_352_s
{
    uint16_t meId;
    uint16_t value1;
    uint16_t value2;
    uint16_t value3;
    uint8_t value4;
    uint32_t vlaue5;
    uint32_t vlaue6;
}omci_reserved_me_352_t, *omci_reserved_me_352_ptr;

typedef struct GNU_PACKED omci_reserved_me_353_s
{
    uint16_t meId;
    uint8_t value1[2];
    uint8_t value2[2];
    uint8_t value3[4];
    uint8_t value4[4];
    uint8_t vlaue5[2];
	uint8_t value6[4];
    uint8_t value7[8];
    uint8_t  value8;
    uint8_t value9[4];
    uint8_t vlaue10[8];
	uint8_t vlaue11[8];
	uint8_t  value[2];
}omci_reserved_me_353_t, *omci_reserved_me_353_ptr;

typedef struct GNU_PACKED omci_reserved_me_367_s
{
    uint16_t meId;
    uint8_t value1;
    uint16_t value2;
    uint16_t value3;
    uint16_t value4;
    uint32_t vlaue5;
}omci_reserved_me_367_t, *omci_reserved_me_367_ptr;

typedef struct GNU_PACKED omci_reserved_me_373_s
{
    uint16_t meId;
    uint8_t value1[2];
    uint8_t value2[2];
    uint8_t value3[4];
    uint8_t value4[4];
    uint8_t value5[4];
	uint8_t value6[2];
	uint8_t value7[2];
	uint8_t value8[2];
	uint8_t value9[2];
	uint8_t value10[2];
	uint8_t value11[2];
	uint8_t value12[2];
	uint8_t value13[2];
	uint8_t value14[2];
}omci_reserved_me_373_t, *omci_reserved_me_373_ptr;

typedef struct GNU_PACKED omci_reserved_me_370_s
{
    uint16_t meId;
    uint8_t value1;
    uint16_t value2;
    uint16_t value3;
    uint16_t value4;
    uint32_t value5;
}omci_reserved_me_370_t, *omci_reserved_me_370_ptr;

typedef struct GNU_PACKED omci_reserved_me_65408_s
{
    uint16_t meId;
    uint8_t value1;
    uint8_t value2[2];
    uint8_t memOccup;
    uint8_t cpuOccup;
    uint16_t temperature;
	uint8_t value6[2];
    uint8_t value7[8];
    uint8_t value8[4];
    uint8_t value9[8];
    uint8_t value10[8];
	uint8_t value11[8];
    uint8_t value12[2];
    uint8_t value13[2];
    uint8_t value14[2];
    uint8_t value15[2];
	uint8_t value16[2];
}omci_reserved_me_65408_t, *omci_reserved_me_65408_ptr;

typedef struct GNU_PACKED omci_reserved_me_65414_s
{
    uint16_t meId;
    uint8_t  value1[2];
    uint8_t  value2[2];
    uint8_t  value3[8];
    uint8_t  value4[2];
    uint8_t  value5[2];
	uint8_t  value6[2];
    uint8_t  value7[2];
    uint8_t  value8[2];
    uint8_t  value9[4];
    uint8_t  value10[2];
	uint8_t  value11[2];
    uint8_t  value12[2];
    uint8_t  value13[2];
    uint8_t  value14[2];
    uint8_t  value15[2];
	uint8_t  value16[2];
}omci_reserved_me_65414_t, *omci_reserved_me_65414_ptr;

typedef struct GNU_PACKED omci_reserved_me_65415_s
{
    uint16_t meId;
    uint8_t value1;
    omci_table_attr_t wanInfoTable;
}omci_reserved_me_65415_t, *omci_reserved_me_65415_ptr;

typedef struct GNU_PACKED omci_reserved_me_65425_s
{
    uint16_t meId;
    uint8_t value1;
    uint16_t value2;
    uint16_t value3;
    uint16_t value4;
    uint32_t value5;
}omci_reserved_me_65425_t, *omci_reserved_me_65425_ptr;

typedef struct GNU_PACKED omci_reserved_me_65427_s
{
    uint16_t meId;
    uint8_t value1;
    uint16_t value2;
    uint16_t value3;
    uint16_t value4;
    uint32_t value5;
}omci_reserved_me_65427_t, *omci_reserved_me_65427_ptr;

#ifdef TCSUPPORT_PON_ROSTELECOM 
//ME353
typedef struct GNU_PACKED omci_huawei_cfg_upload_s
{
    uint16_t meId;
    char     version[14];
    uint8_t  isCommited;
    uint8_t  isActive;
    uint8_t  isValid;
    uint32_t element1;
    uint32_t element2;
	char     cfgVersion;
}omci_huawei_cfg_upload_t, *omci_huawei_cfg_upload_ptr;

int omciHuaweiConfigStartDownloadAction(uint16_t meClassId , omciMeInst_t *meInstant_ptr, omciGenericPayload_t * omciPayLoad, uint8_t msgSrc);
int omciHuaweiConfigDownloadSecAction(uint16_t meClassId , omciMeInst_t *meInstant_ptr, omciGenericPayload_t * omciPayLoad, uint8_t msgSrc);
int omciHuaweiConfigEndDownloadAction(uint16_t meClassId , omciMeInst_t *meInstant_ptr, omciGenericPayload_t * omciPayLoad, uint8_t msgSrc);
int omciHuaweiConfigCommitAction(uint16_t meClassId , omciMeInst_t *meInstant_ptr, omciGenericPayload_t * omciPayLoad, uint8_t msgSrc);
#endif

typedef struct GNU_PACKED omci_eltex_onuG_s
{
	uint16_t meId;
	uint32_t vendorId;
	char version[14];
	char serialNum[8];
	uint8_t TMoption;
	uint8_t deprecated;
	uint8_t battery_backup;
	uint8_t admin_state;
	uint8_t operational_state;
	uint8_t onu_survival_time;
	char logialONUid[24];
	char logialpassword[12];
	uint8_t credentials_status;
	uint16_t extended_tc_op;
}omci_eltex_onuG_t,*omci_eltex_onuG_ptr;

#endif

